import java.util.Scanner;

public class Main1743 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int n = sc.nextInt();
        int x = 0;
        for (int i = m; i <= n; i++) {
            int a=i/10000;
            int b=i/1000%10;
            int c=i%1000/10;
            int d=i%10;
            if (a==d&&b==c){
                x++;
            }
        }
        System.out.println(x);
    }
}

